package com.mayp.supermarket.sales.policy;

/**
 * @Description :水果基类
 * @Author : mayp
 * @Date: 2024/7/12  11:04
 */
public class Fruit {
    // 每斤价格
    protected double pricePerJin;
    // 购买的重量（斤）
    protected int weight;

    public Fruit(double pricePerJin, int weight) {
        this.pricePerJin = pricePerJin;
        this.weight = weight;
    }

    public double calculateTotalPrice() {
        return pricePerJin * weight;
    }
}
